define(['store','util','router'], function (Store,Util,router) {
    function ViewModel(params) {
        Util.extend(this, params);

        var scope = this;

        var store = new Store({
            model: 'mDepartment',
            id: 'departmentStore',
            pageSize:0
        });

        scope.card = {
            title: '部门列表',
            cardBody: {
                name: 'cmp:Grid',
                params: {
                    showOperation: false,
                    store: store,
                    displayFields: ['rowId', {name:'name',click:true}, 'code'],
                    onCellClick:function (data) {
                        router.routeTo({hash:'/ArchiveDepartment&{0}/ArchiveStatistic'.formatTpl(JSON.js2Uri({code:data.record.code()}))})
                     }
                }
            }
        };
    }

    return ViewModel;
});
